import { ConfigProvider } from 'antd';
import { useRecoilValue } from 'recoil';
import { themeConfig } from '@/store/theme';
import { BeforeRouterEnter } from '@/router/components/BeforeRouterEnter';

const App = () => {
    const theme = useRecoilValue(themeConfig);
    const antdTheme = {
        token: {
            colorPrimary: theme.primary,
            colorBgContainer: theme.bgColor,
            borderRadius: 4,
        },
        components: {
            Layout: {},
        },
    };
    return (
        <ConfigProvider theme={antdTheme}>
            <div className="app">
                <BeforeRouterEnter />
            </div>
        </ConfigProvider>
    );
};

export default App;
